import { createSlice } from '@reduxjs/toolkit'

export const counterSlice = createSlice({
	name: 'counter',
	initialState: {
		count: 0,
	},
	reducers: {
		plus(state) {
			state.count = state.count + 1
		},
		minus(state) {
			state.count = state.count - 1
		},
	},
})

export const { plus,minus } = counterSlice.actions
export default counterSlice.reducer
